//
//  RCEditSexVC.m
//  RocketProject
//
//  Created by chen jiedan on 13-11-23.
//  Copyright (c) 2013年 Rocket. All rights reserved.
//

#import "RCEditSexVC.h"

@interface RCEditSexVC ()<UITableViewDataSource,UITableViewDelegate>

@end

@implementation RCEditSexVC
@synthesize delegate = _delegate;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    UITableView *table = [[UITableView alloc] initWithFrame:self.viewContainer.bounds];
    [self.viewContainer addSubview:table];
    table.delegate = self;
    table.dataSource = self;
    [table release];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 2;
}

- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [[UITableViewCell alloc] init];
    if ([indexPath row] == 0) {
        cell.textLabel.text = @"男";
    }else{
        cell.textLabel.text = @"女";
    }
    cell.textLabel.textAlignment = NSTextAlignmentCenter;
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return [cell autorelease];
}


- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if ([indexPath row]  == 0) {
        [_delegate changeSexToMan:YES];
    }else{
        [_delegate changeSexToMan:NO];

    }
    [self.navigationController popViewControllerAnimated:YES];
}
@end
